package com.max.xihu.patterns.factory.activity;

/**
 * @Author: Max
 * @Date: 2020-09-04 22:07
 * @Description:
 */
public class ActivityServiceFactory {

    public ActivityService createActivity(Integer type){
        if (type == null){
            return null;
        }
        if (type == 1)return new ChannelActivityService();
        if (type == 2)return new PromotionActivityService();
        throw new RuntimeException("不存在的活动类型");
    }
}
